package com.example.module_service.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.lib_common.view.entity.CarplateEntity

import com.example.module_service.R
import com.example.module_service.databinding.ItemDeviceDetailBinding
import com.example.module_service.databinding.ItemShengfenBinding

class ShengfenAdapter :BaseQuickAdapter<CarplateEntity,BaseViewHolder>(R.layout.item_shengfen){
    override fun convert(holder: BaseViewHolder, item: CarplateEntity) {
        holder.setText(R.id.name,item.name)
        if (item.name==" "){
            holder.setVisible(R.id.name,false)
        }else{
            holder.setVisible(R.id.name,true)
        }
    }
}

//class ShengfenAdapter(private val data:MutableList<CarplateEntity>):RecyclerView.Adapter<ShengfenAdapter.ShengItemViewHolder>() {
//    inner class ShengItemViewHolder(val itemDataBinding: ItemShengfenBinding):RecyclerView.ViewHolder(itemDataBinding.root)
//
//    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ShengItemViewHolder {
//        return ShengItemViewHolder(ItemShengfenBinding.inflate(LayoutInflater.from(parent.context),parent,false))    }
//
//    override fun getItemCount(): Int {
//        return data.size
//    }
//
//    override fun onBindViewHolder(holder: ShengItemViewHolder, position: Int) {
//        val item = data[position]
//        holder.itemDataBinding.run {
//            entity=item
//            executePendingBindings()
//        }
//    }
//}